
import {ObservableValue} from "src/base/Obs.js"
// import axios from 'axios'
// import qs from 'qs'
var circuitResult = "";
const exportsIsVisible = new ObservableValue(false);
const obsExportsIsShowing = exportsIsVisible.observable().whenDifferent();
// const axios = require("axios");
// const qs = require("qs");　　//qs是一个url参数转化（parse/stringify）的js库

/**
 * @param {!Revision} revision
 */
function initPost(revision) {
    // Show/hide exports overlay.
    (() => {
        const postButton = /** @type {!HTMLButtonElement} */ document.getElementById('circuit_submit');
        postButton.addEventListener('click', () => {
            console.log(revision.history);
            let finalConnt = revision.history.length
            let finalStr = revision.history[finalConnt-1];
           
        parent.setCircuitResult(finalStr);
           console.log(finalStr);
           return finalStr;
        }) 
    })();
   
}

export {initPost, obsExportsIsShowing}
